package itsm.isperp.module.repository.configuration;

import itsm.isperp.framework.data.mybatis.dao.CUDMapper;
import itsm.isperp.module.entity.configuration.ConfCiRelationType;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 数据访问
 * 
 * @author lizx
 * @date 2014-09-22 09:48
 */
@Repository
public interface ConfCiRelationTypeMapper extends CUDMapper<ConfCiRelationType> {

	ConfCiRelationType findByCategory(
			@Param("fromCategoryId") String fromCategoryId,
			@Param("toCategoryId") String toCategoryId);

	List<ConfCiRelationType> findByFromCategoryId(
			@Param("fromCategoryId") String fromCategoryId);

	List<ConfCiRelationType> findAllByToCategoryId(
			@Param("toCategoryId") String toCategoryId);
	

	List<ConfCiRelationType> findAllByFromCategoryId(
			@Param("fromCategoryId") String fromCategoryId);

	List<ConfCiRelationType> findByToCategoryId(
			@Param("toCategoryId") String toCategoryId);

	public List<Map<String, Object>> findAllByCategory(
			@Param("categoryId") String categoryId,
			@Param("categoryParentId") String categoryParentId);
}
